#include <iostream>
using namespace std;
int c[10][10];
int n;
int main()
{
	while(cin>>n){
		if(n==0)break;
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++) cin>>c[i][j];
		}
		int x=0,y=0;
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				if((i+j)%2==0){
					x=x+c[i][j];
				}
				else {
					y=y+c[i][j];
				}
			}
		}
		if(x!=y) {
			cout<<"No"<<endl;
			continue;
		}
		bool flag=true;
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				int sum=0;
				if(i-1>=0)sum=sum+c[i-1][j];
				if(i+1<n)sum=sum+c[i+1][j];
				if(j-1>=0)sum=sum+c[i][j-1];
				if(j+1<n)sum=sum+c[i][j+1];
				if(c[i][j]>sum){
				flag=false;
				}
			}
			if(flag==false) break;
		}
		if(flag==true)	cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
}
